<%@ Page Language="C#" MasterPageFile="~/SecondPage.master" CodeFile="Login.aspx.cs" 
    Inherits="Login_aspx" Title="Login" %>
<asp:Content ID="MainContent" ContentPlaceHolderID="Main" Runat="server">
    <h2 class="section">
                Login</h2>
    <div class="main1">
        <div class="detail-bound">
       
            
            <div class="login">
                <asp:Panel ID="AccessNoticePanel" Runat="server" EnableViewState="False" Visible="False">
                    <b>You have accessed a page or feature that requires login information.</b><br />
                    Use the form below to log in using your account information, or <b>
                    <asp:HyperLink ID="ProtectedPageRegisterLink" Runat="server" NavigateUrl="~/Register.aspx">click here to register</asp:HyperLink></b>.<br />
                    <br />
                </asp:Panel>
                <asp:Login ID="LoginConrol" Runat="server" TitleText="" CssClass="login_box" 
                    DestinationPageUrl="~/Default.aspx" 
                    LoginButtonImageUrl="~/App_Themes/default/images/btn_login.png" 
                    LoginButtonText="" LoginButtonType="Image" 
                    onloggingin="LoginConrol_LoggingIn" UserNameLabelText="Email:">
                    <CheckBoxStyle CssClass="check" />
                <TextBoxStyle CssClass="text"></TextBoxStyle>                
                    <LoginButtonStyle CssClass="btn" />
                    <LabelStyle CssClass="label" />
                    <TitleTextStyle CssClass="title" />
                </asp:Login>
                <div id="fb-root"></div>                  
                  <script src="http://connect.facebook.net/en_US/all.js"></script>
                  <script>
//                  127953910617469 = Facebook App id.
                      FB.init({ appId: '127953910617469', status: true, cookie: true, xfbml: true, channelUrl: "fbresponse.html" });
 
                        FB.Event.subscribe('auth.sessionChange', function(response) {
                            
                            if (response.session) {
                                FB.api('/me', function(response) {                                                                
//                                    this api function cant excute so i  we can't collect the basic user info
//                                    //$("#=hidEmail.ClientID %>").val(response.email);
//                                    //$("#=hidFirstName.ClientID %>").val(response.first_name);
//                                    //$("#=hidLastName.ClientID %>").val(response.last_name);
//                                    //$("#=hidUID.ClientID %>").val(response.id);
//                                    //$("#= fbRegister.ClientID %>").click();
                                });                            
                            } else {
                                // The user has logged out, and the cookie has been cleared
//                                alert("out of session");
                            }
                        });                       
                  </script>
                  <fb:login-button class="fb-button" perms="email,user_checkins">Login with Facebook</fb:login-button>
                <div class="link">
                    <ul>
                    <li><asp:HyperLink ID="RegisterLink" Runat="server" NavigateUrl="~/Register.aspx">Create an Account</asp:HyperLink></li>
                    <li><asp:LinkButton ID="ForgotPasswordButton" Runat="server" OnClick="ForgotPasswordButton_Click">Forgot Password?</asp:LinkButton></li>
                </ul>
                </div>               
                <asp:PasswordRecovery ID="PasswordRecovery" Runat="server" Visible="False"
                     UserNameTitleText="" 
                     QuestionTitleText="Step 2: Identity Confirmation." 
                     UserNameInstructionText="Step 1: Enter your Email." Width="280px" 
                    OnInit="PasswordRecovery_Init" OnSendMailError="PasswordRecovery_SendMailError" 
                    onverifyinguser="PasswordRecovery_VerifyingUser" UserNameLabelText="Email:">
                    <TitleTextStyle Font-Bold="True"></TitleTextStyle>
                    <InstructionTextStyle Font-Bold="True"></InstructionTextStyle>
                    <LabelStyle Wrap="False" />
                </asp:PasswordRecovery>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
            </div>
        </div>
    </div>
</asp:Content>
